package be.music.tool.comparator;
import java.util.Comparator;

import be.music.tool.practice.PracticeEvent;
import be.music.tool.time.Time;


public class PracticeEventComparator implements Comparator<PracticeEvent> {

	@Override
	public int compare(PracticeEvent e1, PracticeEvent e2) {
		
		Time time1 = e1.getStartTime();
		Time time2 = e2.getStartTime();
		int result = 0;
		
		if(time1.isBefore(time2)) {
			result = -1;
		}else if(time1.isAfter(time2)) {
			result = 1;
		}
		
		return result;
	}
	
}
